package com.gayworld.model.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonBackReference;

@Entity
@Table(name = "puntuacion")
public class Rate {
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	private int id;
	 
	 
	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name="idNudismo")
	@JsonBackReference
	private Places place;
	 
	@Column(name = "puntuacion",  nullable = false)
	private Float rate;
		
	@Column(name = "comentario",  nullable = false)
	private String comment;
		
	@Temporal(TemporalType.DATE)
	@Column(name = "fechaAlta", nullable = false)
	private Date registerDate;

	@Temporal(TemporalType.DATE)
	@Column(name = "fechaBaja" )
	private Date unregisterDate;

	
	@Column(name = "userIP")
	private String userIP;
	/**
	 * @return the idRate
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param idRate the idRate to set
	 */
	public void setIdRate(int id) {
		this.id = id;
	}

	/**
	 * @return the place
	*/
	 
	public Places getPlace() {
		return place;
	}
 
	/**
	 * @param place the place to set
	*/
	public void setPlace(Places place) {
		this.place = place;
	}
 
	/**
	 * @return the rate
	 */
	public Float getRate() {
		return rate;
	}

	/**
	 * @param rate the rate to set
	 */
	public void setRate(Float rate) {
		this.rate = rate;
	}

	/**
	 * @return the comment
	 */
	public String getComment() {
		return comment;
	}

	/**
	 * @param comment the comment to set
	 */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/**
	 * @return the registerDate
	 */
	public Date getRegisterDate() {
		return registerDate;
	}

	/**
	 * @param registerDate the registerDate to set
	 */
	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}

	/**
	 * @return the userIP
	 */
	public String getUserIP() {
		return userIP;
	}

	/**
	 * @param userIP the userIP to set
	 */
	public void setUserIP(String userIP) {
		this.userIP = userIP;
	}

	/**
	 * @return the unregisterDate
	 */
	public Date getUnregisterDate() {
		return unregisterDate;
	}

	/**
	 * @param unregisterDate the unregisterDate to set
	 */
	public void setUnregisterDate(Date unregisterDate) {
		this.unregisterDate = unregisterDate;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	} 
	
}
